import { post, get, fileDownload } from '@/utils/request/index';
import ApiUrl from '@/api/url';

// 获取对账明细
export async function searchRecDetail(parms: any) {
  const rtn = (await post(ApiUrl.searchRecDetail, parms)) as any;
  return rtn.data;
}

// 勾兑
export async function workbenchBlending(parms: any) {
  const rtn = (await post(ApiUrl.workbenchBlending, parms)) as any;
  return rtn.data;
}

// 导出对账明细
export async function exportRecDetail(parms: any) {
  const rtn = (await fileDownload(ApiUrl.exportRecDetail, parms)) as any;
  return rtn.data;
}

// 批量取消勾兑
export async function batchBlending(parms: any) {
  const rtn = (await post(ApiUrl.batchBlending, parms)) as any;
  return rtn.data;
}

// 生成调节表
export async function createAdjustment(parms: any) {
  const rtn = (await post(ApiUrl.createAdjustment, parms)) as any;
  return rtn.data;
}

// 获取分类枚举
export async function getCategory(parms) {
  const rtn = (await get(ApiUrl.getCategory, parms)) as any;
  return rtn.data;
}

// 保存对账明细
export async function saveRecDetail(parms: any) {
  const rtn = (await post(ApiUrl.saveRecDetail, parms)) as any;
  return rtn.data;
}

// 异步导出对账明细
export async function asyncExportRecDetail(parms: any) {
  const rtn = (await post(ApiUrl.asyncExportRecDetail, parms)) as any;
  return rtn.data;
}

// 对账列规则
export async function getRecFieldConfig(parms) {
  const rtn = (await get(ApiUrl.getRecFieldConfig, parms)) as any;
  return rtn.data;
}

// 初始化或更新对账列规则
export async function initOrUpdateFieldConfig(parms: any) {
  const rtn = (await post(ApiUrl.initOrUpdateFieldConfig, parms, function (_e) {}, false)) as any;
  return rtn.data;
}
